﻿using RndMaterialDisposalService.Models.RequestModel;

namespace RndMaterialDisposalService.Models.RequestModel
{
    public class ValidationProblemFlowReq
    {
        //1.填写环节
        public ProblemHandling problemHandling { get; set; } = new ProblemHandling();
        //Task 1
        public ValidationProblemTask1Model task1 { get; set; } = new ValidationProblemTask1Model();
        //Task 3
        public ValidationProblemTask3Model task3 { get; set; } = new ValidationProblemTask3Model();
        //Task 4
        public ValidationProblemTask4Model task4 { get; set; } = new ValidationProblemTask4Model();
        //Task 5
        public ValidationProblemTask5Model task5 { get; set; } = new ValidationProblemTask5Model();
        //Task 6
        public ValidationProblemTask6Model task6 { get; set; } = new ValidationProblemTask6Model();
        //Task 7
        public ValidationProblemTask7Model task7 { get; set; } = new ValidationProblemTask7Model();
        //Task 8
        public ValidationProblemTask8Model task8 { get; set; } = new ValidationProblemTask8Model();
        //上传附件
        public List<Attachment> UploadFiles { get; set; } = new List<Attachment>();
        public FormHeader formHeader { get; set; } = new FormHeader();
        public string? viteFormUrl { get; set; }
    }

    //填写环节
    public class ProblemHandling 
    {
        //中试启动单单号
        public string? VerifyStartFolio { get; set; }
        //产品线
        public string? ProductLine { get; set; }
        //项目名称
        public string? ProjectName { get; set; }
        //问题点数
        public string? ProblemNumber { get; set; }
        //问题主题
        public string? ProblemSubject { get; set; }
        //问题来源
        public string? ProblemSources { get; set; }
        //问题来源ID
        public string? ProblemSourcesID { get; set; }
        //产品型号
        public List<string> ProductModel { get; set; } = new List<string>();
        //产品型号ID
        public List<string> ProductModelID { get; set; } = new List<string>();
        //试制批次
        public string? TrialManufactureBatch { get; set; }
        //是否非标
        public bool? Nonstandard { get; set; }
        //产品编码
        public string? ProductCode { get; set; }
        //产品对内型号
        public string? ProductInternalModel { get; set; }
        //本批产品总数
        public int? ProductBatchSum { get; set; }
        //本批产品已生产数
        public int? ProductBatchNumber { get; set; }
        //不良品数
        public int? ProductBadQuantity { get; set; }
        //产品不良比例
        public string? ProductBadRatio { get; set; }
        //不良现象(问题)描述
        public string? Description { get; set; }
        //是否涉及物料问题
        public bool? MaterialProblem { get; set; }
        //本批物料已使用数
        public int? MaterialUsedQuantity { get; set; }
        //不良物料数
        public int? MaterialBadQuantity { get; set; }
        //物料不良比例
        public string? MaterialBadRatio { get; set; }
        //不良物料编码
        public string? MaterialBadCode { get; set; }
        //不良物料型号/名称
        public string? MaterialBadName { get; set; }
        //不良物料供应商
        public string? MaterialBadProvider { get; set; }
        //不良物料批次号
        public string? MaterialBadBatchNum { get; set; }
        //责任部门初步定位
        public string? ResponsibleDepartment { get; set; }
        //责任部门初步定位ID
        public string? ResponsibleDepartmentID { get; set; }
        //问题初步判定
        public string? ProblemDecide { get; set; }
        //问题初步判定ID
        public string? ProblemDecideID { get; set; }
        //问题严重性定位
        public string? SeverityDecide { get; set; }
        //问题严重性定位ID
        public string? SeverityDecideID { get; set; }
        //停线判定
        public string? LineStopDecide { get; set; }
        //停线判定ID
        public string? LineStopDecideID { get; set; }
        //是否停止验证
        public bool? StopValidation { get; set; }
        //停线涉及范围
        public List<string> LineStopRange { get; set; } = new List<string>();

        //停线涉及范围ID
        public List<string> LineStopRangeID { get; set; } = new List<string>();
        //是否影响发货
        public bool? EffectShipments { get; set; }
        //QE/试制处理意见
        public string? QeRemark { get; set; }
        //问题处理责任人
        public string? PersonInCharge { get; set; }
        //问题处理责任人ID
        public string? PersonInChargeID { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //发起人ID
        public string? SubmitByID { get; set; }
        //发起人名称
        public string? SubmitByName { get; set; }
        //选择启动单信息
        public LaunchOrderModel LaunchOrderInfo { get; set; } = new LaunchOrderModel();
        //问题定位(确定状态)
        public string? DetermineProblemPositioning { get; set; }
        //问题判定(确定状态)
        public string? ProblemDetermination { get; set; }
    }

    //Task 1
    public class ValidationProblemTask1Model 
    {
        //意见
        public string? Approval { get; set; }
        //原因分析
        public string? CauseAnalysis { get; set; }
        //临时对策
        public string? TemporaryCountermeasures { get; set; }
        //库存是否暂停发货
        public bool? IsSuspendShipment { get; set; }
        //是否返工
        public bool? IsRework { get; set; }
        //是否涉及ECO
        public bool? IsInvolveECO { get; set; }
        //返工涉及范围
        public List<string> ScopeOfRework { get; set; } = new List<string>();
        //返工涉及范围ID
        public List<string> ScopeOfReworkID { get; set; } = new List<string>();
        //是否对整件(父项)有影响(整件是否要处理) 
        public bool? IsWholePieceImpact { get; set; }
        //解决措施
        public string? SolutionMeasures { get; set; }
        //版本是否升级
        public bool? IsUpgrade { get; set; }
        //长期对策实施时间(天) 
        public decimal? ImplementationCountermeasures { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //审核人（业务主管）
        public string? BusinessSupervisorReview { get; set; }
        //审核人（业务主管）ID
        public string? BusinessSupervisorReviewId { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 3
    public class ValidationProblemTask3Model 
    {
        //意见
        public string? Approval { get; set; }
        //责任归属
        public string? Accountability { get; set; }
        //责任归属ID
        public string? AccountabilityID { get; set; }
        //问题定位
        public string? ProblemPositioning { get; set; }
        //问题定位ID
        public string? ProblemPositioningID { get; set; }
        //问题严重性质
        public string? SeverityProblem { get; set; }
        //问题严重性质ID
        public string? SeverityProblemID { get; set; }
        //意见
        public string? Opinion { get; set; }
        //是否开发遗漏
        public bool? IsDevelopmentOmissions { get; set; }
        //是否测试遗漏
        public bool? IsTestOmission { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 4
    public class ValidationProblemTask4Model 
    {
        //意见
        public string? Approval { get; set; }
        //责任归属
        public string? Accountability { get; set; }
        //责任归属ID
        public string? AccountabilityID { get; set; }
        //问题定位
        public string? ProblemPositioning { get; set; }
        //问题定位ID
        public string? ProblemPositioningID { get; set; }
        //问题严重性质
        public string? SeverityProblem { get; set; }
        //问题严重性质ID
        public string? SeverityProblemID { get; set; }
        //是否安规问题
        public bool? IsSafetyRegulationsIssues { get; set; }
        //是否开发遗漏
        public bool? IsDevelopmentOmissions { get; set; }
        //是否测试遗漏
        public bool? IsTestOmission { get; set; }
        //长期对策确认
        public string? ConfirmationCountermeasures { get; set; }
        //中试期间跟踪人
        public string? PilotTrailer { get; set; }
        //中试期间跟踪人ID
        public string? PilotTrailerId { get; set; }
        //量产期间跟踪人
        public string? MassProductionTracker { get; set; }
        //量产期间跟踪人ID
        public string? MassProductionTrackerId { get; set; }
        //文档归档确认人
        public string? DocumentArchivingConfirmation { get; set; }
        //文档归档确认人ID
        public string? DocumentArchivingConfirmationId { get; set; }
        //跟踪闭环日期
        public DateTime? TrackClosedLoopTime { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 5
    public class ValidationProblemTask5Model 
    {
        //文件是否归档
        public bool? IsFileArchive { get; set; }
        //要求归档日期
        public DateTime? RequiredFilingTime { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 6
    public class ValidationProblemTask6Model 
    {
        //长期对策是否已实施
        public bool? IsSecularGameExecute { get; set; }
        //要求日期
        public DateTime? AskTime { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 7
    public class ValidationProblemTask7Model 
    {
        //意见
        public string? Approval { get; set; }
        //验证分类
        public string? VerifyClassification { get; set; }
        //效果确认日期
        public DateTime? AskTime { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
    }

    //Task 8
    public class ValidationProblemTask8Model 
    {
        //是否跟踪
        public bool? IsTracking { get; set; }
        //意见
        public string? Approval { get; set; }
        //跟踪级别
        public string? TrackingLevel { get; set; }
        //抄送相关人员
        public string? CcUserName { get; set; }
        //抄送相关人员ID
        public string? CcUserNameId { get; set; }
        //备注说明
        public string? Comment { get; set; }
        //问题状态
        public string? ProblemStatus { get; set; }
    }

    public class LaunchOrderModel 
    {
        //主键
        public string? sysId { get; set; }
        //单号
        public string? folio { get; set; }
        //主题
        public string? subject { get; set; }
        //流程实例Id
        public string? procInstId { get; set; }
        //申请人
        public string? applicant { get; set; }
        //申请人Id
        public string? applicantId { get; set; }
        //申请时间
        public DateTime? applicationDate { get; set; }
        //产品线
        public string? productLine { get; set; }
        //项目名称
        public string? projectName { get; set; }
        //项目编码
        public string? projectCode { get; set; }
        //产品型号
        public string? productModelNumber { get; set; }
        //试制批次
        public string? batchNumber { get; set; }
        //验证设计及产品范围
        public List<ERPDeviceInfoDetail> erpDeviceInfoDetaiList { get; set; } = new List<ERPDeviceInfoDetail>();
    }

    public class ERPDeviceInfoDetail 
    {
        public int? id{ get; set; }
        public DateTime? inputTime { get; set; }
        public string? intMod { get; set; }
        public string? itemID { get; set; }
        public string? owner { get; set; }
        public string? prjcode { get; set; }
        public string? status { get; set; }
        public string? describe { get; set; }
        public string? extMod { get; set; }
        public int? batchNum1 { get; set; }
        public int? batchNum2 { get; set; }
        public int? batchNum3 { get; set; }
        public int? verifyNum { get; set; }
    }

    //查询条件-报表
    public class ValidationProblemReportConditionModel 
    {
        //单号
        public string? ProcessFolio { get; set; }
        //验证启动单号
        public string? VerifyStartFolio { get; set; }
        //产品线
        public string? ProductLine { get; set; }
        //项目名称
        public string? ProjectName { get; set; }
        //申请人
        public string? Applicant { get; set; }
        //提交时间
        public string? ApplicantDate { get; set; }
        //当前状态
        public string? CurrentStatus { get; set; }
        //当前用户
        public string? CurrentUser { get; set; }
        //页数
        public int PageIndex { get; set; }
        //条数
        public int PageSize { get; set; }
    }

    //查询条件-中试验证启动单
    public class LaunchOrderConditionModel 
    {
        public string? Keyword { get; set; }
        //页数
        public int PageIndex { get; set; }
        //条数
        public int PageSize { get; set; }
    }

    //邮件知会信息
    public class InformInformation 
    {
        public string ProcInstId { get; set; }
        public string Subject { get; set; }
        public string FunctionId { get; set; }
        public string ViteFormUrl { get; set; }
        public List<string> UserIDList { get; set; } = new List<string>();
    }
}
